package cn.zakrov.sbs003.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/test")
public class TestController {
    private final static Logger logger = LoggerFactory.getLogger(TestController.class);
    @RequestMapping("/log")
    public String testLog() {
        logger.debug("===测试debug级别===");
        logger.info("===测试info级别===");
        logger.error("===测试error级别===");
        logger.warn("===测试warn级别===");

        // 使用占位符打印参数信息
        String s1 = "abcd";
        String s2 = "efgh";
        logger.info("{}, {}", s1, s2);

        return "success";
    }
}
